#import <UIKit/UIKit.h>
#import "MBProgressHUD.h"

typedef void (^WVJBResponseCallback)(id responseData);
typedef void (^WVJBHandler)(id data, WVJBResponseCallback responseCallback);

@interface WebViewJavascriptBridge : NSObject <UIWebViewDelegate>
@property (nonatomic, strong) NSString * JSONData; // 此属性是后添加的 原代码没有此属性
@property (nonatomic, strong) NSString * addJSONData;
@property (nonatomic, assign) BOOL isActivitie;
@property (nonatomic, strong) MBProgressHUD *hudview;
@property (nonatomic, assign) BOOL activitie;
@property (nonatomic, strong) NSString * noimage;

+ (id)bridgeForWebView:(UIWebView*)webView handler:(WVJBHandler)handler;
+ (id)bridgeForWebView:(UIWebView*)webView webViewDelegate:(id <UIWebViewDelegate>)webViewDelegate handler:(WVJBHandler)handler;
+ (void)enableLogging;
- (void)send:(id)message;
- (void)send:(id)message responseCallback:(WVJBResponseCallback)responseCallback;
- (void)registerHandler:(NSString*)handlerName handler:(WVJBHandler)handler;
- (void)callHandler:(NSString*)handlerName;
- (void)callHandler:(NSString*)handlerName data:(id)data;
- (void)callHandler:(NSString*)handlerName data:(id)data responseCallback:(WVJBResponseCallback)responseCallback;
- (void)reset;
- (void)addHUDview:(MBProgressHUD *)HUDview;
@end
   